﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using DcsGauges.Gui.Views;
using DcsGauges.Gui.Rendering.Interfaces;

namespace DcsGauges.Gui.Rendering
{
    static class GuiHost
    {
        private static Stack<View>                    Views                 = new Stack<View>();

        static public void PopView(View scr)
        {
            Views.Pop();
        }

        static public void PushView(View scr)
        {
            Views.Push(scr);
        }

        static public void Render(SpriteBatch uiBatch, GraphicsDevice device, Point viewportSize)
        {
            if(Views.Count > 0)
            { 
                Views.Peek().Render(uiBatch, device, new Rectangle(0, 0, viewportSize.X, viewportSize.Y), 0.5f);
            }
        }
    }
}
